using System; using System.Data; using System.Windows.Forms; using System.Xml;
namespace WindowsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); }
private void button1_Click(object sender, EventArgs e) { XmlReader xmlFile; xmlFile = XmlReader.Create("Product.xml", new XmlReaderSettings()); DataSet ds = new DataSet(); ds.ReadXml(xmlFile); int i = 0; for (i = 0; i <= ds.Tables[0].Rows.Count - 1; i++) { MessageBox.Show(ds.Tables[0].Rows[i].ItemArray[2].ToString()); } } } }
Liked By
Write Answer
Open and read an XML file to Dataset
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy
Join MindStick Community
You have need login or register for voting of answers or question.
Sumit Kesarwani
15-Jun-2013